 |
ALPHA-VISION® HowTo: Text Change-Over
|
Text Change-Over
SUMMARY
Gives information how texts, dependent on process data, can be switched over.
CONTENTS
- Task formulation
- Solution 1 - Text change-over via Text file
- Solution 2 - Text change-over by Attribut Condition Table.
- Solution 3 - Text change-over by Figure Condition Table.
Task formulation
In runtime the following messages should be displayed for a motor:
Forward Slow, Forward Fast, Backwards, Stop, Failure
The information is given by the Data Object “MOTOR_1” by returning the
following values:
| Condition |
Value |
| Forward Slow |
1 |
| Forward Fast |
2 |
| Backwards |
5 |
| Stop |
0 |
| Failure |
7 |
Solution 1 - Text change-over via Text file
- Place an arbitrary text at the wanted position.
- Via the ‘Category’ “Variables” bind the Dynamic Function
Obj_CondTxt(MOTOR_1,Messages.txt,MOTORS)
to the text.
- Use any editor to create the text file “Messages.txt” with the
following content:
[MOTORS]; Section name
X0=Stop
X1=Forward Slow
X2=Forward Fast
X5=Backwards
X7=Failure
- Result in runtime
- In the text field the texts of the section “MOTORS” are displayed
according the values of Data Object “MOTOR_1”
For return values not defined the text field stays empty.
Further Hints
The “X” in front of the value stays for ‘Project Language’.
If in the project the ALPHA-VISION
®-facility
MLS (Multiple
Language Support) for dynamic language switch-over in runtime is
used, a text-entry for any language defined must be made in the same section.
The “X” thereby is replaced by the ‘LanguageID’ defined in MLS.
Example of an enlarged text file for the LanguageID “G” for German:
[MOTORS]
X0=stop
X1=Forward Slow
X2=Forward Fast
X5=Backward
X7=Failure
G0=stop
G1=Vorwärts-langsam
G2=Vorwärts-schnell
G5=Rückwärts
G7=Störung
- The font for the text depends on the settings in the editor.
- Dynamisation of color and font is not possible.
- Any text change-over of that kind can be written to the same text
file using different sections.
Solution 2 - Text change-over by Attribut Condition Table.
- Create all Texts in the wanted font and size.
(All Text fields should be of the same size)
- Via the ‘Category’ “Dynamic” bind the Function
Obj_ValCmp(MOTOR_1,n) to any of the texts.
(Thereby “n” is replaced by the value allocated to the text.
so by “0” for the text “Stop”, “5” for “Backwards” and so on.)
Define the Attribut Condition Table (e.g. Text_Dis)
- Place all textfields above each other by using the ‘Arrange’ / ‘Align’
function in the editor.
- Create the defined Attribut Condition Table (e.g. Text_Dis) as follows:

(see also:
AbvEditor,
Chapter "Attribute condition tables"
- Result in runtime
- In the text fields lying upon each other only that one is visible whose
value matches that one returned by the Data Object “MOTOR_1”.
Further Hints
- The font and font-size depends of what is set up in the editor.
- To display texts in different colors you have to define and create
different Attribute Condition Tables.
- If you expect, e.g. on system start-up, that the Data Object “MOTOR_1”
might have values not defined in the table, it is advisable to place a
static text e.g. “undefined” as background to the text fields.
Solution 3 - Text change-over by Figure Condition Table.
- Create all Texts in the wanted font, color and size as separate Figures.
(All Text Figures should be of the same size)
- Place one of the figures at the wanted position and bind the function
Obj_ValueInt(MOTOR_1) > via ‘Category’
“Dynamic” to it and define a Figure Condition Table (e.g. Txt_Dis).
- Create the defined Figure Condition Table (e.g. Txt_Dis) as follows:

(see also:
AbvEditor,
Chapter "Figure Condition table"
- Result in runtime
- The figure that matches the return value of Data Object “MOTOR_1” is
displayed.
For values not defined in the Figure Condition Table the figure “UNDEF”
is displayed.
Further Hints
- The font, font-size und colors are as defined in the figures.